thin.imports('/public/plug/banner/banner.js');
thin.imports('/public/configure/conf.agency.js');
thin.imports('/public/webfe/resource/lazyImage.js');

thin.use(function() {
	var lazy = thin.lazyImage;
	lazy();

	var banner = thin.banner;
	banner();
	
	// 獲取合作機構列表
	factory.request('_agency_volist');
});

// 獲取合作機構列表回調
function __complete_agencylist(res) {
	if(res.status == 200) {
		if(res.data.length > 0) {
			createOrg(res.data);
		}
	} else {
		layer.msg(res.error, {
			icon: 2,
			time: 800
		});
	}
}

// 顯示合作機構
function createOrg(data) {
	var ele = '';
	for (var i in data) {
		var list = data[i];
		ele += '<a href="/organization/' + list.id + '.html" class="box"><img src="' + list.logo + '" /></a>';
	}
	$('#tpl-org-view').html(ele);
}
